import { axios } from "@/request/axios.js";

// 后台登录
export const getSwiperImageLisT = () => {
  return axios({
    url: "/main-page-swiper/getSwiperImageLisT",
    method: "get",
    headers: {
      token: localStorage.getItem('token')
    }
  });
};

// 后台添加或者编辑轮播图
export const addOrEditSwiper = (data) => {
  return axios({
    url: "/main-page-swiper/addOrEditSwiper",
    method: "post",
    data:data,
    headers: {
      token: localStorage.getItem('token')
    }
  });
};


// 根据轮播图的类型获取编码
export const getCode = (param) => {
  return axios({
    url: "/main-page-swiper/getCode",
    method: "get",
    params:param,
    headers: {
      token: localStorage.getItem('token')
    }
  });
};


// 根据轮播图aid删除轮播图
export const deleteSwiperByAid = (param) => {
  return axios({
    url: "/main-page-swiper/deleteSwiperByAid",
    method: "delete",
    params:param,
    headers: {
      token: localStorage.getItem('token')
    }
  });
};
